using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace project
{
    public partial class ReportHome : Form
    {
        public DateTime dt=new DateTime();
        public ReportHome()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
                 
            DateTime dt1 = new DateTime(dateTimePicker1.Value.Year,dateTimePicker1.Value.Month,dateTimePicker1.Value.Day);
        //    dt1 = dateTimePicker1.Value;    
            Mag_Report.report_date = dt1;
            Mag_Report.report_type = comboBox1.Text;
            Mag_Report.report_on = comboBox2.Text;
            Mag_Report mag_rep=(Mag_Report) Program.ReturnFormInstance(this, "project.Mag_Report");
            mag_rep.rep_home = this;
            if (mag_rep.crystalReportViewer1.ReportSource == null)
            {
                MessageBox.Show("No reports available !!!");
            }
            else
            {
                mag_rep.ShowDialog();
            }

            /*Mag_Report mag = new Mag_Report();
            mag.Show();*/
        }
        private void ReportHome_Load(object sender, EventArgs e)
        {

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void ReportHome_FormClosing(object sender, FormClosingEventArgs e)
        {
                Program.main_form.Show();
            
        }
    }
}